package com.wt.controller;

import com.wt.pojo.UserInfo;
import com.wt.service.UserService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping
public class ConsumerController {

    @Resource
    private UserService userService;

    @PostMapping
    public String Add(UserInfo userInfo)
    {
        System.out.println("消费者添加="+userInfo);
        return userService.Add(userInfo);
    }

    @DeleteMapping("/{id}")
    public String del(@PathVariable("id") Integer id){
        System.out.println("消费者删除："+id);
        return userService.del(id);
    }

    @GetMapping
    public String get(UserInfo userInfo){
        System.out.println("消费者查询："+userInfo);
        return userService.get(userInfo);
    }
}
